
/**
 *
 * @param {Function} asynFn 返回promise对象
 * @param {object} param 需要给方法专递的参数
 * @returns {Array} [错误信息，值]
 * @description asnyc await使用try catch的辅助函数
 */
export default async function errorCaptrued (asynFn, param) {
  try {
    let res = await asynFn(param)
    return [null, res]
  } catch (e) {
    return [e, null]
  }
}
